package com.admin.dao;

import com.admin.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author szy
 * @since 2023-02-21
 */
public interface UserMapper extends BaseMapper<User> {

    /*删除用户-角色关系*/
    @Delete("delete from user_role_relation where user_id=#{userId}")
    int deleteUserRole(Long userId);

    /**
     * 保存用户角色关系
     */
    int saveUserRole(Long userId, List<Long> roleIds);


    List<User> findUserByRoleId(Long roleId);
}
